// @ts-ignore
/* eslint-disable */

// 功放相关
import {
  LoudspeakerParams,
  LoudspeakerResult,
  LoudspeakerResultItem,
} from '@/services/api/model/loudspeakerModel';
import { request } from '@umijs/max';
/** 获取设备 GET  */
export async function getList(params?: LoudspeakerParams, options?: { [key: string]: any }) {
  return request<LoudspeakerResult>(API_URL + '/superlink/api/devices/boxs', {
    method: 'GET',
    params,
    ...(options || {}),
  });
}

export async function delItem(id: string) {
  return request(API_URL + '/superlink/api/devices/box/delete/' + id, {
    method: 'DELETE',
  });
}

export async function createItem(data: LoudspeakerResultItem) {
  return request(API_URL + '/superlink/api/devices/box/create', {
    method: 'POST',
    data,
  });
}
export async function updateItem(data: LoudspeakerResultItem) {
  return request(API_URL + '/superlink/api/devicetypes/update/' + data.token, {
    method: 'PUT',
    data,
  });
}

/** 获取设备类型详情 GET  */
export async function getDetails(params: { token: string }, options?: { [key: string]: any }) {
  return request<LoudspeakerResultItem>(API_URL + '/superlink/api/devices/box/' + params.token, {
    method: 'GET',
    params,
    ...(options || {}),
  });
}
